package com.beimin.evedata.model.map;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.beimin.evedata.model.chr.ChrFaction;

@Entity
@Table(name = "mapregions")
public class MapRegion implements java.io.Serializable {
	@Id
	@Column(name = "regionID", unique = true, nullable = false)
	private int regionId;
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "factionID")
	private ChrFaction faction;
	@Column(name = "regionName", length = 100)
	private String regionName;
	@Column(name = "x", precision = 22, scale = 0)
	private Double x;
	@Column(name = "y", precision = 22, scale = 0)
	private Double y;
	@Column(name = "z", precision = 22, scale = 0)
	private Double z;
	@Column(name = "xMin", precision = 22, scale = 0)
	private Double xmin;
	@Column(name = "xMax", precision = 22, scale = 0)
	private Double xmax;
	@Column(name = "yMin", precision = 22, scale = 0)
	private Double ymin;
	@Column(name = "yMax", precision = 22, scale = 0)
	private Double ymax;
	@Column(name = "zMin", precision = 22, scale = 0)
	private Double zmin;
	@Column(name = "zMax", precision = 22, scale = 0)
	private Double zmax;
	@Column(name = "radius", precision = 22, scale = 0)
	private Double radius;
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mapregionsByToRegionId")
	private Set<MapSolarSystemJump> mapsolarsystemjumpsesForToRegionId = new HashSet<MapSolarSystemJump>(0);
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mapregionsByToRegionId")
	private Set<MapConstellationJump> mapconstellationjumpsesForToRegionId = new HashSet<MapConstellationJump>(0);
	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinTable(name = "mapregionjumps", joinColumns = { @JoinColumn(name = "toRegionID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "fromRegionID", nullable = false, updatable = false) })
	private Set<MapRegion> mapregionsesForFromRegionId = new HashSet<MapRegion>(0);
	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinTable(name = "mapregionjumps", joinColumns = { @JoinColumn(name = "fromRegionID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "toRegionID", nullable = false, updatable = false) })
	private Set<MapRegion> mapregionsesForToRegionId = new HashSet<MapRegion>(0);
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "region")
	private Set<MapSolarSystem> solarSystems = new HashSet<MapSolarSystem>(0);
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mapregionsByFromRegionId")
	private Set<MapConstellationJump> mapconstellationjumpsesForFromRegionId = new HashSet<MapConstellationJump>(0);
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "mapregionsByFromRegionId")
	private Set<MapSolarSystemJump> mapsolarsystemjumpsesForFromRegionId = new HashSet<MapSolarSystemJump>(0);

	public MapRegion() {
	}

	public MapRegion(int regionId) {
		this.regionId = regionId;
	}

	public MapRegion(int regionId, ChrFaction chrfactions, String regionName, Double x, Double y, Double z, Double xmin, Double xmax, Double ymin, Double ymax,
			Double zmin, Double zmax, Double radius, Set<MapSolarSystemJump> mapsolarsystemjumpsesForToRegionId,
			Set<MapConstellationJump> mapconstellationjumpsesForToRegionId, Set<MapRegion> mapregionsesForFromRegionId, Set<MapRegion> mapregionsesForToRegionId,
			Set<MapSolarSystem> solarSystems, Set<MapConstellationJump> mapconstellationjumpsesForFromRegionId,
			Set<MapSolarSystemJump> mapsolarsystemjumpsesForFromRegionId) {
		this.regionId = regionId;
		this.faction = chrfactions;
		this.regionName = regionName;
		this.x = x;
		this.y = y;
		this.z = z;
		this.xmin = xmin;
		this.xmax = xmax;
		this.ymin = ymin;
		this.ymax = ymax;
		this.zmin = zmin;
		this.zmax = zmax;
		this.radius = radius;
		this.mapsolarsystemjumpsesForToRegionId = mapsolarsystemjumpsesForToRegionId;
		this.mapconstellationjumpsesForToRegionId = mapconstellationjumpsesForToRegionId;
		this.mapregionsesForFromRegionId = mapregionsesForFromRegionId;
		this.mapregionsesForToRegionId = mapregionsesForToRegionId;
		this.solarSystems = solarSystems;
		this.mapconstellationjumpsesForFromRegionId = mapconstellationjumpsesForFromRegionId;
		this.mapsolarsystemjumpsesForFromRegionId = mapsolarsystemjumpsesForFromRegionId;
	}

	public int getRegionId() {
		return this.regionId;
	}

	public void setRegionId(int regionId) {
		this.regionId = regionId;
	}

	public ChrFaction getFaction() {
		return this.faction;
	}

	public void setFaction(ChrFaction faction) {
		this.faction = faction;
	}

	public String getRegionName() {
		return this.regionName;
	}

	public void setRegionName(String regionName) {
		this.regionName = regionName;
	}

	public Double getX() {
		return this.x;
	}

	public void setX(Double x) {
		this.x = x;
	}

	public Double getY() {
		return this.y;
	}

	public void setY(Double y) {
		this.y = y;
	}

	public Double getZ() {
		return this.z;
	}

	public void setZ(Double z) {
		this.z = z;
	}

	public Double getXmin() {
		return this.xmin;
	}

	public void setXmin(Double xmin) {
		this.xmin = xmin;
	}

	public Double getXmax() {
		return this.xmax;
	}

	public void setXmax(Double xmax) {
		this.xmax = xmax;
	}

	public Double getYmin() {
		return this.ymin;
	}

	public void setYmin(Double ymin) {
		this.ymin = ymin;
	}

	public Double getYmax() {
		return this.ymax;
	}

	public void setYmax(Double ymax) {
		this.ymax = ymax;
	}

	public Double getZmin() {
		return this.zmin;
	}

	public void setZmin(Double zmin) {
		this.zmin = zmin;
	}

	public Double getZmax() {
		return this.zmax;
	}

	public void setZmax(Double zmax) {
		this.zmax = zmax;
	}

	public Double getRadius() {
		return this.radius;
	}

	public void setRadius(Double radius) {
		this.radius = radius;
	}

	public Set<MapSolarSystemJump> getMapsolarsystemjumpsesForToRegionId() {
		return this.mapsolarsystemjumpsesForToRegionId;
	}

	public void setMapsolarsystemjumpsesForToRegionId(Set<MapSolarSystemJump> mapsolarsystemjumpsesForToRegionId) {
		this.mapsolarsystemjumpsesForToRegionId = mapsolarsystemjumpsesForToRegionId;
	}

	public Set<MapConstellationJump> getMapconstellationjumpsesForToRegionId() {
		return this.mapconstellationjumpsesForToRegionId;
	}

	public void setMapconstellationjumpsesForToRegionId(Set<MapConstellationJump> mapconstellationjumpsesForToRegionId) {
		this.mapconstellationjumpsesForToRegionId = mapconstellationjumpsesForToRegionId;
	}

	public Set<MapRegion> getMapregionsesForFromRegionId() {
		return this.mapregionsesForFromRegionId;
	}

	public void setMapregionsesForFromRegionId(Set<MapRegion> mapregionsesForFromRegionId) {
		this.mapregionsesForFromRegionId = mapregionsesForFromRegionId;
	}

	public Set<MapRegion> getMapregionsesForToRegionId() {
		return this.mapregionsesForToRegionId;
	}

	public void setMapregionsesForToRegionId(Set<MapRegion> mapregionsesForToRegionId) {
		this.mapregionsesForToRegionId = mapregionsesForToRegionId;
	}

	public Set<MapSolarSystem> getSolarSystems() {
		return this.solarSystems;
	}

	public void setSolarSystems(Set<MapSolarSystem> solarSystems) {
		this.solarSystems = solarSystems;
	}

	public Set<MapConstellationJump> getMapconstellationjumpsesForFromRegionId() {
		return this.mapconstellationjumpsesForFromRegionId;
	}

	public void setMapconstellationjumpsesForFromRegionId(Set<MapConstellationJump> mapconstellationjumpsesForFromRegionId) {
		this.mapconstellationjumpsesForFromRegionId = mapconstellationjumpsesForFromRegionId;
	}

	public Set<MapSolarSystemJump> getMapsolarsystemjumpsesForFromRegionId() {
		return this.mapsolarsystemjumpsesForFromRegionId;
	}

	public void setMapsolarsystemjumpsesForFromRegionId(Set<MapSolarSystemJump> mapsolarsystemjumpsesForFromRegionId) {
		this.mapsolarsystemjumpsesForFromRegionId = mapsolarsystemjumpsesForFromRegionId;
	}

}
